package com.gzhryc.weixin.api.event.msg.resp;

import com.gzhryc.common.xml.annotation.XmlElement;
import com.gzhryc.weixin.api.event.msg.EventObject;
import com.gzhryc.weixin.api.event.msg.IEventRespMessage;

/**
 * 文本响应消息
 * @author 张浩
 * @version 0.1.0
 */
@XmlElement("xml")
public class TextRespMessage implements IEventRespMessage{

	@XmlElement
	private String ToUserName;
	@XmlElement
	private String FromUserName;
	@XmlElement
	private Long CreateTime;
	@XmlElement
	private String MsgType = "text";
	@XmlElement
	private String Content;
	
	public String getToUserName() {
		return ToUserName;
	}
	public void setToUserName(String toUserName) {
		ToUserName = toUserName;
	}
	public String getFromUserName() {
		return FromUserName;
	}
	public void setFromUserName(String fromUserName) {
		FromUserName = fromUserName;
	}
	public Long getCreateTime() {
		return CreateTime;
	}
	public void setCreateTime(Long createTime) {
		CreateTime = createTime;
	}
	public String getMsgType() {
		return MsgType;
	}
	public void setMsgType(String msgType) {
		MsgType = msgType;
	}
	public String getContent() {
		return Content;
	}
	public void setContent(String content) {
		Content = content;
	}
	
	public static TextRespMessage create(EventObject entity){
		TextRespMessage resp = new TextRespMessage();
		resp.setCreateTime(entity.getCreateTime());
		resp.setFromUserName(entity.getToUserName());
		resp.setToUserName(entity.getFromUserName());
		return resp;
	}
}
